from IPython.display import Image
Image("img/adhd.png")
from IPython.display import Image
Image("img/differences.png")
The Diagnostic and Statistical Manual of Mental Disorders, fifth edition (DSM-5) defines attention deficit–hyperactivity disorder (ADHD) as a by symptoms of impulsivity, inattention, and hyperactivity that emerge in childhood (Table 1). ADHD was initially considered to be solely a childhood disorder, and the diagnosis of adult ADHD2 was controversial.3 However, long-term follow-up studies revealed that in 40 to 60% of children with ADHD, the disorder persists into adulthood.4–7
- Inattention/memory,
- Hyperactivity/resltessness,
- Impulsivity/emotional lability,
- Self-concept
- General, auditive and visual scores for attentionnal quotient
- General, auditive and visual scores for response control quotient
# Plot distribution
sns.distplot(df_conners['cIM'], color='green', rug=True)
# Test data normality
print('Test result and p value are:',(stats.shapiro(df_conners['cIM'])))
Test result and p value are: (0.9636342525482178, 2.50556929836056e-39)
# Plot distribution
sns.distplot(df_conners['cHR'], color='green', rug=True)
# Test data normality
print('Test result and p value are:',(stats.shapiro(df_conners['cHR'])))
Test result and p value are: (0.9744826555252075, 3.754574644685725e-34)
# Plot distribution
sns.distplot(df_conners['cIE'], color='green', rug=True)
# Test data normality
print('Test result and p value are:',(stats.shapiro(df_conners['cIE'])))
Test result and p value are: (0.9720873832702637, 1.994776461682145e-35)
# Plot distribution
sns.distplot(df_conners['cSC'], color='green', rug=True)
# Test data normality
print('Test result and p value are:',(stats.shapiro(df_conners['cSC'])))
Test result and p value are: (0.9808207154273987, 2.9404705305593402e-30)
# Create distplot with custom bin_size
fig = ff.create_distplot(hist_data, group_labels, show_hist=False)
fig.update_layout(title_text='Conners Questionnaire : Self report data')
fig.show()
# Create distplot with custom bin_size
fig = ff.create_distplot(hist_data, group_labels, show_hist=False)
fig.update_layout(title_text='IVA-II : Behavioral data')
fig.show()
fig = px.scatter(df, x="RCQtot", y="Aqtot", facet_col="adhdtype", color="Gender", trendline="ols")
fig.show()
https://github.com/hyruuk/hytools/blob/master/hytools/meg_utils.py
from mne.io import read_raw_ctf
import os
import matplotlib
import mne
import numpy as np
from mne.preprocessing import ICA, create_eog_epochs, create_ecg_epochs
import time
from IPython.display import clear_output
import mne
import matplotlib.pyplot as plt
from scipy.io import savemat, loadmat
from mpl_toolkits.axes_grid1 import make_axes_locatable
from bokeh.models import HoverTool
import bokeh.plotting as bplt
def array_topoplot(toplot, ch_xy, showtitle=True, titles=titles, savefig=False, figpath=None, vmin=0, vmax=30, cmap='jet', with_mask=False, masks=None, show=True):
#create fig
mask_params = dict(marker='o', markerfacecolor='w', markeredgecolor='k', linewidth=0, markersize=5)
fig, ax = plt.subplots(1,len(toplot), figsize=(20,10))
# mplcursors.cursor(hover=True)
for i, data in enumerate(toplot):
if with_mask == False:
image,_ = mne.viz.plot_topomap(data=data, pos=ch_xy, cmap=cmap, vmin=vmin, vmax=vmax, axes=ax[i], show=False, contours=None, extrapolate='box', outlines='head')
elif with_mask == True:
image,_ = mne.viz.plot_topomap(data=data, pos=ch_xy, cmap=cmap, vmin=vmin, vmax=vmax, axes=ax[i], show=False, contours=None, mask_params=mask_params, mask=masks[i], extrapolate='box', outlines='head')
#option for title
if showtitle == True:
ax[i].set_title(titles[i], fontdict={'fontsize': 20, 'fontweight': 'heavy'})
#add a colorbar at the end of the line (weird trick from https://www.martinos.org/mne/stable/auto_tutorials/stats-sensor-space/plot_stats_spatio_temporal_cluster_sensors.html#sphx-glr-auto-tutorials-stats-sensor-space-plot-stats-spatio-temporal-cluster-sensors-py)
divider = make_axes_locatable(ax[-1])
ax_colorbar = divider.append_axes('right', size='5%', pad=0.05)
plt.colorbar(image, cax=ax_colorbar)
ax_colorbar.tick_params(labelsize=14)
#save plot if specified
if savefig == True:
plt.savefig(figpath, dpi=300)
if show == True:
plt.show()
plt.close(fig=fig)
else:
plt.close(fig=fig)
return fig
array_topoplot(data, ch_xy); # ";" needed in notebook so it doesn't print in double, maybe remove if on other ide
array_topoplot(data_adhd1, ch_xy);
array_topoplot(data_adhd2, ch_xy);
array_topoplot(divide_adhd, ch_xy, vmin = -1, vmax = 1);
array_topoplot(data_gender1, ch_xy);
array_topoplot(data_gender2, ch_xy);
array_topoplot(divide_gender, ch_xy, vmin=-1.5, vmax=1.5);